package io.renren.modules.sys.controller;

import java.util.Arrays;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.renren.common.vo.RV;
import io.renren.modules.sys.entity.OrgExtra;
import io.renren.modules.sys.service.OrgExtraService;



/**
 * 组织扩展信息
 *
 * @author jingtang
 * @email sunlightcs@gmail.com
 * @date 2018-06-28 08:41:11
 */
@RestController
@RequestMapping("sys/orgextra")
public class OrgExtraController extends AbstractController{
    @Autowired
    private OrgExtraService orgExtraService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sys:orgextra:list")
    public RV list(@RequestParam Map<String, Object> params){
       

        return RV.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{orgExtraId}")
    @RequiresPermissions("sys:orgextra:info")
    public RV info(@PathVariable("orgExtraId") String orgExtraId){
			OrgExtra orgExtra = orgExtraService.selectById(orgExtraId);

        return RV.ok(orgExtra);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("sys:orgextra:save")
    public RV save(@RequestBody OrgExtra orgExtra){
			orgExtraService.insert(orgExtra);

        return RV.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("sys:orgextra:update")
    public RV update(@RequestBody OrgExtra orgExtra){
			orgExtraService.updateById(orgExtra);

        return RV.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("sys:orgextra:delete")
    public RV delete(@RequestBody String[] orgExtraIds){
			orgExtraService.deleteBatchIds(Arrays.asList(orgExtraIds));

        return RV.ok();
    }

}
